package net.lastcoder.ifserver.route;

import net.lastcoder.ifserver.packet.Packet;
import net.lastcoder.ifserver.session.Session;

/**
 * auth: WenYF
 * date: 2016/10/22
 */
public interface PacketInterceptor {
    /**消息拦截器
     * @param packet 消息
     * @param session 会话
     * @param incoming 是否是进来消息
     * @param process 是否已经处理过
     * @throws PacketRejectedException 抛出异常消息不在处理，在这里丢弃
     */
    void interceptPacket(Packet packet, Session session, boolean incoming
            , boolean process) throws PacketRejectedException;
}
